app.controller('ZhuyeCtrl', ['$scope', 'DataService', 'UtilFactory', '$http', '$location', function ($scope, DataService, UtilFactory, $http, $location) {

	$scope.tabbardj($scope.navBtns, 0);
	// console.log($scope.navBtns);
	// 使用$http发起网络请求
    $http({
        method: 'GET',
        url: '../../aixianfeng/data/home.json'
    }).then(function (res) {
        $scope.data = res.data.data;

        $scope.lis = res.data.data.act_info[1].act_rows;
		 // 酸牛奶，进口山竹，进口零食
		$scope.lisImg = res.data.data.act_info[3];

		// 闪送超市
		$scope.lisImgTwo = res.data.data.act_info[4].act_rows[0].act_rows[0].chead_detail;

		// 热销榜 和 新鲜品尝
		$scope.lisImgTh = res.data.data.act_info[4].act_rows[1].act_rows;

		// 牛奶面包，饮料酒水，优选水果，更多
		$scope.lisImgFour = res.data.data.act_info[4].act_rows[2].act_rows;

		// 鸭货不能听两张图片
		$scope.lisImgDuck = res.data.data.act_info[4].act_rows[3].act_rows;

		// 优选水果
		$scope.goodFruit = res.data.data.act_info[5].act_rows;
    });

    $scope.add = function () {
        DataService.addItem(this.data7);
        console.log(DataService.getAllGoods());
    };

}])
